.class public Lrexsee/ebook/PageFactory;
.super Ljava/lang/Object;
.source "PageFactory.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lrexsee/ebook/PageFactory$FactoryThread;
    }
.end annotation


# static fields
.field public static final DEFAULT_PARAGRAPH_SPLIT:Ljava/lang/String; = "\n"


# instance fields
.field private final defaultBackground:Landroid/graphics/drawable/Drawable;

.field private final defaultPaint:Landroid/graphics/Paint;

.field private final defaultRect:Landroid/graphics/Rect;

.field private final defaultVerticalAlign:Ljava/lang/String;

.field private isLoading:Z

.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private mData:Ljava/lang/String;

.field public final mHeight:I

.field private final mPageView:Lrexsee/ebook/PageView;

.field private final mPages:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList",
            "<",
            "Lrexsee/ebook/Page;",
            ">;"
        }
    .end annotation
.end field

.field public final mStyle:Lrexsee/core/style/StyleSheet;

.field private mThread:Lrexsee/ebook/PageFactory$FactoryThread;

.field public final mWidth:I


# direct methods
.method public constructor <init>(Lrexsee/ebook/PageView;Lrexsee/core/style/StyleSheet;)V
    .locals 9
    .param p1, "pageView"    # Lrexsee/ebook/PageView;
    .param p2, "styleSheet"    # Lrexsee/core/style/StyleSheet;

    .prologue
    const/4 v8, 0x0

    const-string v5, "px"

    const-string v4, ""

    .line 35
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 31
    const/4 v2, 0x1

    iput-boolean v2, p0, Lrexsee/ebook/PageFactory;->isLoading:Z

    .line 37
    iput-object p1, p0, Lrexsee/ebook/PageFactory;->mPageView:Lrexsee/ebook/PageView;

    .line 38
    iget-object v2, p1, Lrexsee/ebook/PageView;->mBrowser:Lrexsee/core/browser/Browser;

    iput-object v2, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    .line 39
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    iput-object v2, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    .line 40
    iput-object p2, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    .line 42
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mPageView:Lrexsee/ebook/PageView;

    invoke-virtual {v2}, Lrexsee/ebook/PageView;->getWidth()I

    move-result v1

    .line 43
    .local v1, "w":I
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mPageView:Lrexsee/ebook/PageView;

    invoke-virtual {v2}, Lrexsee/ebook/PageView;->getHeight()I

    move-result v0

    .line 44
    .local v0, "h":I
    if-lez v1, :cond_0

    move v2, v1

    :goto_0
    iput v2, p0, Lrexsee/ebook/PageFactory;->mWidth:I

    .line 45
    if-lez v0, :cond_1

    move v2, v0

    :goto_1
    iput v2, p0, Lrexsee/ebook/PageFactory;->mHeight:I

    .line 47
    new-instance v2, Landroid/graphics/Rect;

    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getLabelPaddingLeft()I

    move-result v3

    iget-object v4, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v4}, Lrexsee/core/style/StyleSheet;->getLabelPaddingTop()I

    move-result v4

    iget v5, p0, Lrexsee/ebook/PageFactory;->mWidth:I

    iget-object v6, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v6}, Lrexsee/core/style/StyleSheet;->getLabelPaddingRight()I

    move-result v6

    sub-int/2addr v5, v6

    iget v6, p0, Lrexsee/ebook/PageFactory;->mHeight:I

    iget-object v7, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v7}, Lrexsee/core/style/StyleSheet;->getLabelPaddingBottom()I

    move-result v7

    sub-int/2addr v6, v7

    invoke-direct {v2, v3, v4, v5, v6}, Landroid/graphics/Rect;-><init>(IIII)V

    iput-object v2, p0, Lrexsee/ebook/PageFactory;->defaultRect:Landroid/graphics/Rect;

    .line 48
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->text_vertical_align:Ljava/lang/String;

    iput-object v2, p0, Lrexsee/ebook/PageFactory;->defaultVerticalAlign:Ljava/lang/String;

    .line 49
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v3, v3, Lrexsee/core/style/StyleSheet;->label_background_color:Ljava/lang/String;

    invoke-static {v2, v3}, Lrexsee/core/style/RexseeDrawable;->getDrawable(Lrexsee/core/browser/Browser;Ljava/lang/String;)Landroid/graphics/drawable/Drawable;

    move-result-object v2

    iput-object v2, p0, Lrexsee/ebook/PageFactory;->defaultBackground:Landroid/graphics/drawable/Drawable;

    .line 50
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->defaultBackground:Landroid/graphics/drawable/Drawable;

    iget v3, p0, Lrexsee/ebook/PageFactory;->mWidth:I

    iget v4, p0, Lrexsee/ebook/PageFactory;->mHeight:I

    invoke-virtual {v2, v8, v8, v3, v4}, Landroid/graphics/drawable/Drawable;->setBounds(IIII)V

    .line 51
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->defaultBackground:Landroid/graphics/drawable/Drawable;

    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v3}, Lrexsee/core/style/StyleSheet;->getAlpha()F

    move-result v3

    const/high16 v4, 0x437f0000    # 255.0f

    mul-float/2addr v3, v4

    invoke-static {v3}, Ljava/lang/Math;->round(F)I

    move-result v3

    invoke-virtual {v2, v3}, Landroid/graphics/drawable/Drawable;->setAlpha(I)V

    .line 52
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-static {v2}, Lrexsee/ebook/PageFactory;->getPaint(Lrexsee/core/style/StyleSheet;)Landroid/graphics/Paint;

    move-result-object v2

    iput-object v2, p0, Lrexsee/ebook/PageFactory;->defaultPaint:Landroid/graphics/Paint;

    .line 54
    return-void

    .line 44
    :cond_0
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->width:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v2

    const-string v3, "px"

    const-string v3, ""

    invoke-virtual {v2, v5, v4}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const/16 v3, 0xf0

    invoke-static {v2, v3}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v2

    int-to-float v2, v2

    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget v3, v3, Lrexsee/core/application/RexseeApplication;->screenDensity:F

    mul-float/2addr v2, v3

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v2

    goto/16 :goto_0

    .line 45
    :cond_1
    iget-object v2, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    iget-object v2, v2, Lrexsee/core/style/StyleSheet;->height:Ljava/lang/String;

    invoke-virtual {v2}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v2

    const-string v3, "px"

    const-string v3, ""

    invoke-virtual {v2, v5, v4}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    const/16 v3, 0x140

    invoke-static {v2, v3}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v2

    int-to-float v2, v2

    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v3, v3, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget v3, v3, Lrexsee/core/application/RexseeApplication;->screenDensity:F

    mul-float/2addr v2, v3

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v2

    goto/16 :goto_1
.end method

.method static synthetic access$0(Lrexsee/ebook/PageFactory;)Landroid/graphics/Rect;
    .locals 1

    .prologue
    .line 23
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->defaultRect:Landroid/graphics/Rect;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/ebook/PageFactory;)Landroid/graphics/Paint;
    .locals 1

    .prologue
    .line 26
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->defaultPaint:Landroid/graphics/Paint;

    return-object v0
.end method

.method static synthetic access$2(Lrexsee/ebook/PageFactory;)Ljava/lang/String;
    .locals 1

    .prologue
    .line 29
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mData:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$3(Lrexsee/ebook/PageFactory;)Ljava/lang/String;
    .locals 1

    .prologue
    .line 24
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->defaultVerticalAlign:Ljava/lang/String;

    return-object v0
.end method

.method static synthetic access$4(Lrexsee/ebook/PageFactory;)Landroid/graphics/drawable/Drawable;
    .locals 1

    .prologue
    .line 25
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->defaultBackground:Landroid/graphics/drawable/Drawable;

    return-object v0
.end method

.method static synthetic access$5(Lrexsee/ebook/PageFactory;Z)V
    .locals 0

    .prologue
    .line 31
    iput-boolean p1, p0, Lrexsee/ebook/PageFactory;->isLoading:Z

    return-void
.end method

.method static synthetic access$6(Lrexsee/ebook/PageFactory;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 22
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$7(Lrexsee/ebook/PageFactory;)Ljava/util/ArrayList;
    .locals 1

    .prologue
    .line 27
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    return-object v0
.end method

.method static synthetic access$8(Lrexsee/ebook/PageFactory;)Lrexsee/ebook/PageView;
    .locals 1

    .prologue
    .line 21
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mPageView:Lrexsee/ebook/PageView;

    return-object v0
.end method

.method public static getPaint(Lrexsee/core/style/StyleSheet;)Landroid/graphics/Paint;
    .locals 10
    .param p0, "style"    # Lrexsee/core/style/StyleSheet;

    .prologue
    const/4 v9, 0x1

    const/4 v8, 0x0

    .line 133
    new-instance v3, Landroid/graphics/Paint;

    invoke-direct {v3, v9}, Landroid/graphics/Paint;-><init>(I)V

    .line 134
    .local v3, "paint":Landroid/graphics/Paint;
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->color:Ljava/lang/String;

    invoke-static {v5}, Lrexsee/core/style/RexseeDrawable;->getIntColor(Ljava/lang/String;)I

    move-result v5

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setColor(I)V

    .line 135
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->font_size:Ljava/lang/String;

    invoke-virtual {v5}, Ljava/lang/String;->toLowerCase()Ljava/lang/String;

    move-result-object v5

    const-string v6, "px"

    const-string v7, ""

    invoke-virtual {v5, v6, v7}, Ljava/lang/String;->replaceAll(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v5

    const/16 v6, 0x18

    invoke-static {v5, v6}, Lrexsee/core/utilities/Utilities;->getInt(Ljava/lang/String;I)I

    move-result v5

    int-to-float v5, v5

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setTextSize(F)V

    .line 136
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->font_weight:Ljava/lang/String;

    const-string v6, "bold"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setFakeBoldText(Z)V

    .line 137
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->font_style:Ljava/lang/String;

    const-string v6, "italic"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v5

    if-eqz v5, :cond_1

    const/high16 v5, -0x41800000    # -0.25f

    :goto_0
    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setTextSkewX(F)V

    .line 138
    invoke-virtual {p0}, Lrexsee/core/style/StyleSheet;->getAlpha()F

    move-result v5

    const/high16 v6, 0x437f0000    # 255.0f

    mul-float/2addr v5, v6

    float-to-int v5, v5

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setAlpha(I)V

    .line 139
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_shadow_radius:Ljava/lang/String;

    invoke-static {v5, v8}, Lrexsee/core/utilities/Utilities;->getFloat(Ljava/lang/String;F)F

    move-result v4

    .line 140
    .local v4, "radius":F
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_shadow_dx:Ljava/lang/String;

    invoke-static {v5, v8}, Lrexsee/core/utilities/Utilities;->getFloat(Ljava/lang/String;F)F

    move-result v1

    .line 141
    .local v1, "dx":F
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_shadow_dy:Ljava/lang/String;

    invoke-static {v5, v8}, Lrexsee/core/utilities/Utilities;->getFloat(Ljava/lang/String;F)F

    move-result v2

    .line 142
    .local v2, "dy":F
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_shadow_color:Ljava/lang/String;

    invoke-static {v5}, Lrexsee/core/style/RexseeDrawable;->getIntColor(Ljava/lang/String;)I

    move-result v0

    .line 143
    .local v0, "color":I
    invoke-virtual {v3, v4, v1, v2, v0}, Landroid/graphics/Paint;->setShadowLayer(FFFI)V

    .line 144
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_align:Ljava/lang/String;

    const-string v6, "right"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_2

    .line 145
    sget-object v5, Landroid/graphics/Paint$Align;->RIGHT:Landroid/graphics/Paint$Align;

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setTextAlign(Landroid/graphics/Paint$Align;)V

    .line 151
    :goto_1
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_decoration:Ljava/lang/String;

    const-string v6, "underline"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_4

    .line 152
    invoke-virtual {v3, v9}, Landroid/graphics/Paint;->setUnderlineText(Z)V

    .line 157
    :cond_0
    :goto_2
    return-object v3

    .end local v0    # "color":I
    .end local v1    # "dx":F
    .end local v2    # "dy":F
    .end local v4    # "radius":F
    :cond_1
    move v5, v8

    .line 137
    goto :goto_0

    .line 146
    .restart local v0    # "color":I
    .restart local v1    # "dx":F
    .restart local v2    # "dy":F
    .restart local v4    # "radius":F
    :cond_2
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_align:Ljava/lang/String;

    const-string v6, "center"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_3

    .line 147
    sget-object v5, Landroid/graphics/Paint$Align;->CENTER:Landroid/graphics/Paint$Align;

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setTextAlign(Landroid/graphics/Paint$Align;)V

    goto :goto_1

    .line 149
    :cond_3
    sget-object v5, Landroid/graphics/Paint$Align;->LEFT:Landroid/graphics/Paint$Align;

    invoke-virtual {v3, v5}, Landroid/graphics/Paint;->setTextAlign(Landroid/graphics/Paint$Align;)V

    goto :goto_1

    .line 153
    :cond_4
    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_decoration:Ljava/lang/String;

    const-string v6, "strikethru"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-nez v5, :cond_5

    iget-object v5, p0, Lrexsee/core/style/StyleSheet;->text_decoration:Ljava/lang/String;

    const-string v6, "strikethrough"

    invoke-virtual {v5, v6}, Ljava/lang/String;->equalsIgnoreCase(Ljava/lang/String;)Z

    move-result v5

    if-eqz v5, :cond_0

    .line 154
    :cond_5
    invoke-virtual {v3, v9}, Landroid/graphics/Paint;->setStrikeThruText(Z)V

    goto :goto_2
.end method


# virtual methods
.method public clear()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 67
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->clear()V

    .line 68
    iput-object v1, p0, Lrexsee/ebook/PageFactory;->mThread:Lrexsee/ebook/PageFactory$FactoryThread;

    .line 69
    iput-object v1, p0, Lrexsee/ebook/PageFactory;->mData:Ljava/lang/String;

    .line 70
    const/4 v0, 0x1

    iput-boolean v0, p0, Lrexsee/ebook/PageFactory;->isLoading:Z

    .line 71
    return-void
.end method

.method public destroy()V
    .locals 1

    .prologue
    .line 88
    const/4 v0, 0x0

    iput-object v0, p0, Lrexsee/ebook/PageFactory;->mThread:Lrexsee/ebook/PageFactory$FactoryThread;

    .line 89
    return-void
.end method

.method public getLoadingBitmap(Ljava/lang/String;)Landroid/graphics/Bitmap;
    .locals 10
    .param p1, "text"    # Ljava/lang/String;

    .prologue
    const/4 v9, 0x0

    .line 77
    :try_start_0
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mStyle:Lrexsee/core/style/StyleSheet;

    invoke-virtual {v1}, Lrexsee/core/style/StyleSheet;->clone()Lrexsee/core/style/StyleSheet;

    move-result-object v1

    const-string v2, "text-align:center;font-style:italic;"

    invoke-virtual {v1, v2}, Lrexsee/core/style/StyleSheet;->parseStyle(Ljava/lang/String;)Lrexsee/core/style/StyleSheet;

    move-result-object v1

    invoke-static {v1}, Lrexsee/ebook/PageFactory;->getPaint(Lrexsee/core/style/StyleSheet;)Landroid/graphics/Paint;

    move-result-object v8

    .line 78
    .local v8, "paint":Landroid/graphics/Paint;
    new-instance v0, Lrexsee/ebook/Page;

    const-string v2, "middle"

    iget-object v3, p0, Lrexsee/ebook/PageFactory;->defaultRect:Landroid/graphics/Rect;

    iget-object v4, p0, Lrexsee/ebook/PageFactory;->defaultBackground:Landroid/graphics/drawable/Drawable;

    const/4 v5, 0x0

    const/4 v6, 0x0

    move-object v1, p0

    invoke-direct/range {v0 .. v6}, Lrexsee/ebook/Page;-><init>(Lrexsee/ebook/PageFactory;Ljava/lang/String;Landroid/graphics/Rect;Landroid/graphics/drawable/Drawable;Lrexsee/core/style/StyleSheet;Lrexsee/core/style/StyleSheet;)V

    .line 79
    .local v0, "loadingPage":Lrexsee/ebook/Page;
    new-instance v1, Lrexsee/ebook/TextLine;

    const/16 v2, 0xe

    invoke-direct {v1, p1, v2, v8}, Lrexsee/ebook/TextLine;-><init>(Ljava/lang/String;ILandroid/graphics/Paint;)V

    invoke-virtual {v0, v1}, Lrexsee/ebook/Page;->add(Lrexsee/ebook/LineInterface;)V

    .line 80
    invoke-virtual {v0}, Lrexsee/ebook/Page;->draw()Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    .line 83
    .end local v0    # "loadingPage":Lrexsee/ebook/Page;
    .end local v8    # "paint":Landroid/graphics/Paint;
    :goto_0
    return-object v1

    .line 81
    :catch_0
    move-exception v1

    move-object v7, v1

    .line 82
    .local v7, "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    const-string v2, "PageFactory.getLoadingBitmap"

    invoke-virtual {v1, v2, v7}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move-object v1, v9

    .line 83
    goto :goto_0
.end method

.method public getPage(I)Landroid/graphics/Bitmap;
    .locals 5
    .param p1, "index"    # I

    .prologue
    const/4 v3, 0x0

    const/4 v2, 0x1

    const-string v4, "PageFactory.getPage"

    .line 92
    if-gez p1, :cond_0

    const/4 p1, 0x0

    .line 93
    :cond_0
    iget-boolean v1, p0, Lrexsee/ebook/PageFactory;->isLoading:Z

    if-eqz v1, :cond_2

    .line 94
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    sub-int/2addr v1, v2

    if-le p1, v1, :cond_1

    move-object v1, v3

    .line 110
    :goto_0
    return-object v1

    .line 98
    :cond_1
    :try_start_0
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v1, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lrexsee/ebook/Page;

    invoke-virtual {v1}, Lrexsee/ebook/Page;->draw()Landroid/graphics/Bitmap;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    move-result-object v1

    goto :goto_0

    .line 99
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 100
    .local v0, "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    const-string v2, "PageFactory.getPage"

    invoke-virtual {v1, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move-object v1, v3

    .line 101
    goto :goto_0

    .line 105
    .end local v0    # "e":Ljava/lang/Exception;
    :cond_2
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    sub-int/2addr v1, v2

    if-le p1, v1, :cond_3

    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v1}, Ljava/util/ArrayList;->size()I

    move-result v1

    sub-int p1, v1, v2

    .line 107
    :cond_3
    :try_start_1
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v1, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lrexsee/ebook/Page;

    invoke-virtual {v1}, Lrexsee/ebook/Page;->draw()Landroid/graphics/Bitmap;
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    move-result-object v1

    goto :goto_0

    .line 108
    :catch_1
    move-exception v1

    move-object v0, v1

    .line 109
    .restart local v0    # "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    const-string v2, "PageFactory.getPage"

    invoke-virtual {v1, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move-object v1, v3

    .line 110
    goto :goto_0
.end method

.method public getPages()Ljava/util/ArrayList;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/ArrayList",
            "<",
            "Lrexsee/ebook/Page;",
            ">;"
        }
    .end annotation

    .prologue
    .line 120
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    return-object v0
.end method

.method public getTotal()I
    .locals 1

    .prologue
    .line 116
    iget-boolean v0, p0, Lrexsee/ebook/PageFactory;->isLoading:Z

    if-eqz v0, :cond_0

    const/4 v0, -0x1

    :goto_0
    return v0

    :cond_0
    iget-object v0, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    goto :goto_0
.end method

.method public isLoading()Z
    .locals 1

    .prologue
    .line 73
    iget-boolean v0, p0, Lrexsee/ebook/PageFactory;->isLoading:Z

    return v0
.end method

.method public parse(Ljava/lang/String;)V
    .locals 3
    .param p1, "data"    # Ljava/lang/String;

    .prologue
    .line 57
    iput-object p1, p0, Lrexsee/ebook/PageFactory;->mData:Ljava/lang/String;

    .line 59
    :try_start_0
    new-instance v1, Lrexsee/ebook/PageFactory$FactoryThread;

    invoke-direct {v1, p0}, Lrexsee/ebook/PageFactory$FactoryThread;-><init>(Lrexsee/ebook/PageFactory;)V

    iput-object v1, p0, Lrexsee/ebook/PageFactory;->mThread:Lrexsee/ebook/PageFactory$FactoryThread;

    .line 60
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mThread:Lrexsee/ebook/PageFactory$FactoryThread;

    invoke-virtual {v1}, Lrexsee/ebook/PageFactory$FactoryThread;->start()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 64
    :goto_0
    return-void

    .line 61
    :catch_0
    move-exception v1

    move-object v0, v1

    .line 62
    .local v0, "e":Ljava/lang/Exception;
    iget-object v1, p0, Lrexsee/ebook/PageFactory;->mBrowser:Lrexsee/core/browser/Browser;

    const-string v2, "PageFactory.thread"

    invoke-virtual {v1, v2, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    goto :goto_0
.end method

.method public searchText(Ljava/lang/String;)Ljava/util/ArrayList;
    .locals 4
    .param p1, "text"    # Ljava/lang/String;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/lang/String;",
            ")",
            "Ljava/util/ArrayList",
            "<",
            "Lrexsee/ebook/Page;",
            ">;"
        }
    .end annotation

    .prologue
    .line 123
    new-instance v2, Ljava/util/ArrayList;

    invoke-direct {v2}, Ljava/util/ArrayList;-><init>()V

    .line 124
    .local v2, "rtn":Ljava/util/ArrayList;, "Ljava/util/ArrayList<Lrexsee/ebook/Page;>;"
    const/4 v0, 0x0

    .local v0, "i":I
    :goto_0
    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v3}, Ljava/util/ArrayList;->size()I

    move-result v3

    if-lt v0, v3, :cond_0

    .line 128
    return-object v2

    .line 125
    :cond_0
    iget-object v3, p0, Lrexsee/ebook/PageFactory;->mPages:Ljava/util/ArrayList;

    invoke-virtual {v3, v0}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lrexsee/ebook/Page;

    .line 126
    .local v1, "page":Lrexsee/ebook/Page;
    invoke-virtual {v1, p1}, Lrexsee/ebook/Page;->containsText(Ljava/lang/String;)Z

    move-result v3

    if-eqz v3, :cond_1

    invoke-virtual {v2, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 124
    :cond_1
    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method
